package com.supostacks.domain.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.supostacks.domain.repository.ICategoryRepository;
import com.supostacks.domain.repository.IFeedbackRepository;
import com.supostacks.domain.service.ICategoryService;
import com.supostacks.domain.service.IFeedbackService;
import com.supostacks.domain.vo.FeedbackVo;
import com.supostacks.domain.vo.FeedbackVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Service
public class FeedbackServiceImpl implements IFeedbackService {
    @Resource
    private IFeedbackRepository feedbackRepository;

    @Override
    public String insert(FeedbackVo feedbackVo) {
        return feedbackRepository.insert(feedbackVo);
    }

    @Override
    public void deleteById(String id) {
        feedbackRepository.deleteById(id);
    }

    @Override
    public String updateById(FeedbackVo feedbackVo) {
        return feedbackRepository.updateById(feedbackVo);
    }

    @Override
    public FeedbackVo selectById(String id) {
        return feedbackRepository.selectById(id);
    }

    @Override
    public List<FeedbackVo> selectList(JSONObject param) {
        List<FeedbackVo> feedbackVos = feedbackRepository.selectList(param);
        return new ArrayList<>(feedbackVos);
    }

    @Override
    public JSONObject selectByPage(JSONObject param,int pageNo,int pageSize) {
        return feedbackRepository.selectByPage(param,pageNo,pageSize);
    }

}
